from langchain_openai import ChatOpenAI
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from transformers import AutoTokenizer, AutoModel
import os


class MyLocalModel:
    model: object = None

    def __init__(self):
        super().__init__()
        model = AutoModel.from_pretrained("D:\\my_models\\deepseek-ai\\DeepSeek-R1-Distill-Qwen-1___5B",
                                          trust_remote_code=True, device_map="auto")
        model = model.eval()
        self.model = model


model = MyLocalModel()
res = model.model.chat("你是谁？")
print(res)
